package com.hsq.file_;

import java.io.BufferedInputStream;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;

public class InputChain {
    public static void main(String[] args) {
        String fileName = "D:\\git_turtle\\mixedTypes.dat";
        int sum = 0;
        try {
            DataInputStream instr = new DataInputStream(
                    new BufferedInputStream(new FileInputStream(fileName))
            );
            sum += instr.readInt();
            sum += instr.readInt();
            sum += instr.readInt();
            System.out.println("The sum is: " + sum);
            instr.close();
        } catch (IOException e) {
            System.out.println(e.toString());
        }
    }
}
